package main

import (
	"fmt"

	libvirt "github.com/libvirt/libvirt-go"

)

func main() {
	// conn, err := libvirt.NewConnect("qemu:///system")
	conn, err := libvirt.NewConnect("qemu+tcp://<node_ip>:<node_port>/system")
	if err != nil {
		fmt.Println("connect error")
	}
	defer conn.Close()

	hostname, err := conn.GetHostname()
	if err != nil {
		fmt.Println("gethostname error")
	}

	fmt.Println("hostname is:", hostname)
}
